import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)


const modulesFile = require.context("./modules", false, /\.js$/);
let modules = {};
modulesFile.keys().forEach(key => {
	let name = key.replace(/(.*\/)*([^.]+).*/gi, "$2");
	modules[name] = modulesFile(key).default;
});

const store = new Vuex.Store({
	state: {
		appReady: false
	},
	mutations: {
		setAppReady(state) {
			state.appReady = true
		}
	},
	getters: {

	},
	actions: {

	},
	modules
})

export default store
